﻿using System;
using UnityEngine;
using Utility;

// Token: 0x020002BD RID: 701
public class LogoScene : Scene
{
	// Token: 0x06001208 RID: 4616 RVA: 0x000764B8 File Offset: 0x000746B8
	private void Start()
	{
		base.InScene(false);
		ScreenFade.StartFade(ScreenFade.TYPE.IN, base.GC.FadeColor, this.fadeInTime, 0f, null, true);
		this.timer = 0f;
		this.roll = 0f;
		Vector3 position = this.title.transform.position;
		position.y = this.titleStartY;
		this.title.transform.position = position;
		this.isFirstFrame = true;
		if (this.bgm.Length > 0)
		{
			base.GC.audioCtrl.BGM_LoadAndPlay(this.bgm, false, false);
		}
	}

	// Token: 0x06001209 RID: 4617 RVA: 0x00076560 File Offset: 0x00074760
	private void Update()
	{
		if (this.isFirstFrame)
		{
			this.isFirstFrame = false;
			return;
		}
		this.roll += this.rollSpeed * Time.deltaTime;
		this.circle.transform.localRotation = Quaternion.Euler(0f, 0f, this.roll);
		Color color = this.title.color;
		color.a = Tween.Spring(color.a, 1f, this.titleSpeed, Time.deltaTime, 0f, 0f);
		this.title.color = color;
		Vector3 localPosition = this.title.transform.localPosition;
		localPosition.y = Tween.Spring(localPosition.y, this.titleGoalY, this.titleSpeed, Time.deltaTime, 0f, 0f);
		this.title.transform.localPosition = localPosition;
		if (base.GC.sceneCtrl.IsFading)
		{
			return;
		}
		this.timer += Time.deltaTime;
		if (this.timer >= this.endTime)
		{
			base.GC.ChangeScene(this.nextScene, this.nextMessage, this.fadeOutTime);
		}
		else if (this.GetInput())
		{
			base.GC.ChangeScene(this.nextScene, this.nextMessage, base.GC.FadeTime);
		}
	}

	// Token: 0x0600120A RID: 4618 RVA: 0x000766DC File Offset: 0x000748DC
	private bool GetInput()
	{
		return Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter) || Input.GetKeyDown(KeyCode.Escape);
	}

	// Token: 0x040013CE RID: 5070
	private float timer;

	// Token: 0x040013CF RID: 5071
	public SpriteRenderer circle;

	// Token: 0x040013D0 RID: 5072
	public float rollSpeed = 30f;

	// Token: 0x040013D1 RID: 5073
	public SpriteRenderer title;

	// Token: 0x040013D2 RID: 5074
	public float titleSpeed = 5f;

	// Token: 0x040013D3 RID: 5075
	public float titleStartY = -1f;

	// Token: 0x040013D4 RID: 5076
	public float titleGoalY;

	// Token: 0x040013D5 RID: 5077
	public float endTime = 3f;

	// Token: 0x040013D6 RID: 5078
	public string nextScene = "Title";

	// Token: 0x040013D7 RID: 5079
	public string nextMessage = string.Empty;

	// Token: 0x040013D8 RID: 5080
	public float fadeInTime = 1f;

	// Token: 0x040013D9 RID: 5081
	public float fadeOutTime = 1f;

	// Token: 0x040013DA RID: 5082
	public string bgm = string.Empty;

	// Token: 0x040013DB RID: 5083
	private float roll;

	// Token: 0x040013DC RID: 5084
	private bool isFirstFrame = true;
}
